let $db := doc("xp")
return 
	insert node 
		<users>
		{
			for $user in $db/ranking//resultsByInscription/users//user
			order by number($user/note) descending
			return
					<user>
						<name>{$user/name/text()}</name>
						<note>{$user/note/text()}</note>
						<rank/>
					</user>
		}
		</users>
	into $db//inscriptionRanking